//
//  WBComposeTypeButton.swift
//  SinaWebo
//
//  Created by 亚杏 on 2017/5/31.
//  Copyright © 2017年 oms. All rights reserved.
//

import UIKit

class WBComposeTypeButton: UIControl {
    @IBOutlet weak var imageView: UIImageView!

    @IBOutlet weak var titleLabel: UILabel!

    //点击按钮，要展现控制器的类名
    var clsName: String?

    //使用图像名称和图片创建按钮，布局从xib加载
    class func composeTypeButton(imageName: String, title: String) -> WBComposeTypeButton {
        let nib = UINib(nibName: "WBComposeTypeButton", bundle: nil)
        let btn = nib.instantiate(withOwner: nil, options: nil)[0] as! WBComposeTypeButton
        btn.imageView.image = UIImage(named: imageName)
        btn.titleLabel.text = title

        return btn
    }
}
